<template>
    <div>
        {{ $props.modelValue }}
        <button @click="change">改变</button>
    </div>
</template>

<script setup lang="ts">
    import { ref } from 'vue'

    const $props = defineProps({
        modelValue: Number,
    })
    const $emit = defineEmits(['update:modelValue'])
    const num = ref(0)
    const change = () => {
        $emit('update:modelValue', num.value + 1)
        num.value = num.value + 1
    }
</script>
<style lang="scss" scoped></style>
